<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: d11yu
  Date: 2022/4/9
  Time: 17:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
关系运算 <br>
${12==12}
<hr>
逻辑运算 <br>
${12==12 && 12>11} <br>
${!true} <br>
<hr>
算术运算 <br>
${10/3} <br>
<hr>
empty运算 <br>
<%
    pageContext.setAttribute("emptyNull", null);
    pageContext.setAttribute("emptyString", "");
    pageContext.setAttribute("emptyArr", new Object[]{});
    pageContext.setAttribute("emptyList", new ArrayList<>());
    pageContext.setAttribute("emptyMap", new HashMap<String, String>());
%>
emptyNull: ${empty emptyNull} <br>
emptyString: ${empty emptyString} <br>
emptyArr: ${empty emptyArr} <br>
emptyList: ${empty emptyList} <br>
emptyMap: ${empty emptyMap} <br>
<hr>
三元运算 <br>
${12==11?true:false}
<hr>
“.”点运算 和 [] 中括号运算符 <br>
<%
    Map<String, String> map = new HashMap<>();
    map.put("k1", "v1");
    map.put("k.2", "v2");
    map.put("k+3", "v3");
    pageContext.setAttribute("map", map);
%>
map: ${map} <br>
map.k1: ${map.k1} <br>
map["k.2"]: ${map["k.2"]} <br>
map["k+3"]: ${map["k+3"]} <br>
</body>
</html>
